/*!
   \file

   \brief
      Types used for the background implementation of the platform on Windows OS.

   © 2011 Mark W. Gabby II

   This file is part of Rock Hunter.

   Rock Hunter is free software: you can redistribute it and/or modify it under the terms of the
   GNU General Public License as published by the Free Software Foundation, either version 3 of the
   License, or (at your option) any later version.

   Rock Hunter is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
   even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License along with Rock Hunter.
   If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <map>
#include <vector>

#define WIN32_LEAN_AND_MEAN
#ifndef WINVER
#define WINVER 0x501 // Windows XP
#endif
#include <windows.h>

#include "WindowsWindow.hpp"

typedef uint32_t tSystemScreenModeIndex;
typedef uint32_t tSystemPixelFormatIndex;
typedef uint8_t tSystemMonitorIndex;

typedef std::pair<tScreenModeIndex, tMonitorIndex> tModeAndMonitor;
struct WinPFDataStruct
{
   ~WinPFDataStruct()
   {
      for ( uint32_t i = 0; i < Windows.size(); ++i )
      {
         delete Windows[i];
         Windows[i] = NULL;
      }

      Windows.clear();
   }

   // Screen Mode Information
   std::map<tModeAndMonitor, ScreenModeInfo> ModeAndMonitorToScreenMode;
   std::map<tModeAndMonitor, tSystemScreenModeIndex> ModeAndMonitorToSystemScreenModeIndex;
   std::map<tMonitorIndex, tScreenModeIndex> ModesPerMonitor;

   // Pixel Format Information
   std::vector<PixelFormat> SupportedPixelFormats;
   std::map<tPixelFormatIndex, tSystemPixelFormatIndex> SupportedPixelFormatsToSystemPixelFormats;

   // Monitor Information
   std::vector<MonitorInfo> MonitorInfos;
   std::map<tMonitorIndex, tSystemMonitorIndex> MonitorIndexToSystemMonitorIndex;
   std::vector<HMONITOR> MonitorHandles;

   // Controller information
   std::vector<ControllerInfo> ControllerInfos;

   // Windows
   std::map<HWND, WindowsWindow *> HandlesToWindows;
   std::vector<WindowsWindow *> Windows;

};
extern WinPFDataStruct gPFData;
